/*
 * $Id: QEHamData.m 90 2009-07-16 03:06:57Z jon@bway.net $
 * Chalk
 *
 * Created by Jon Gordon on 9/24/08
 * Copyright Jon Gordon.  All rights reserved.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining 
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including 
 * without limitation the rights to use, copy, modify, merge, publish, 
 * distribute, sublicense, and/or sell copies of the Software, and to 
 * permit persons to whom the Software is furnished to do so, subject to 
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#import "QEHamData.h"

#import "QEBand.h"
#import "QEMode.h"

#import "QENameToUIDTransformer.h"


static NSArray *modes = nil;
@implementation QEHamData
+ (void)initialize
{
    //-NSLog(@"MESSAGE: %s", __PRETTY_FUNCTION__);
    static BOOL initialized = NO;
    if (!initialized) {
        //-NSLog(@"  initializing QEHamData");
        initialized = YES;
        modes = [[NSArray arrayWithObjects:@"CW", @"SSB", nil] retain];
    } // if
} // initialize

+ (void)createAllValueTransformers
{
    //-NSLog(@"MESSAGE: %s", __PRETTY_FUNCTION__);
    QENameToUIDTransformer *xfrmr = [[[QENameToUIDTransformer alloc] init] autorelease];
    [xfrmr setTable:[NSSet setWithArray:[QEBand allBandsAsArray]]];
    [NSValueTransformer setValueTransformer:xfrmr forName:qeTransformerBandNameToUid];
    
    xfrmr = [[[QENameToUIDTransformer alloc] init] autorelease];
    [xfrmr setTable:[NSSet setWithArray:[QEMode allModes]]];
    [NSValueTransformer setValueTransformer:xfrmr forName:qeTransformerModeNameToUid];
} // createAllValueTransformers


+ (NSArray *)allModes
{
    //-NSLog(@"MESSAGE: %s", __PRETTY_FUNCTION__);
    return modes;
} // allModes


- (NSArray *)modes
{
    //-NSLog(@"MESSAGE: %s", __PRETTY_FUNCTION__);
    return [QEHamData allModes];
} // allModes
@end
